<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<base href="<%=basePath%>">
<title>广告注册</title>
<link rel="stylesheet" rev="stylesheet" href="css/style1.css" type="text/css" media="all" />

<style type="text/css">
<!--
.atten {font-size:12px;font-weight:normal;color:#F00;}
-->
</style>
<script language="JavaScript">
	//广告的注册
function addAdevert(){
  alert(2);
	document.editAdvertForm.action = "advertAct.action";
	alert(document.editAdvertForm.action);
	document.editAdvertForm.submit();
}
	
//广告的修改
function uptAdevert(){
	document.editAdvertForm.action = "advertAct!uptAdvert.action";
	document.editAdvertForm.submit();
}
</script>

</head>
<body class="ContentBody">
  <form action="advertAct.action" method="post" name="editAdvertForm" id="editAdvertForm" enctype="multipart/form-data">
  <s:hidden name="advertVo.id" value="%{advertVo.id}"></s:hidden>
	<s:set name="butFlgVal" value="%{butFlgVal}" />
		<div class="MainDiv">
		<table width="99%" border="0" cellpadding="0" cellspacing="0" class="CContent">
		  <tr>
		  	<s:if test="#butFlgVal!='upt'">                          
					<th class="tablestyle_title" >广告注册页面</th>
				</s:if>
				<s:else>
			  	<th class="tablestyle_title" >广告修改页面</th>
				</s:else>
		  </tr>
		  <tr>
		    <td class="CPanel">			
				<table border="0" cellpadding="0" cellspacing="0" style="width:100%">
				<tr>
					<td width="100%">
						<fieldset style="height:100%;">
						<legend>广告注册</legend>
							<table border="0" cellpadding="2" cellspacing="1" style="width:100%">						 	
							 	 <tr>
							    <td nowrap="nowrap" align="right" width="13%">所属广告位:</td>
							    <td width="87%">
							    	<s:action name="advertTypeAct!findAdvertAddressName" id="advertDefTypeAct"/>	
							      <s:select name="advertVo.advertAddressId" listKey="id"
											listValue="advertName" 	list="#advertDefTypeAct.advertAddressNameVoList" theme="simple" />
						        <span class="red"> *</span>
						      </td>
							  </tr>						 	
							  <tr>
							    <td nowrap="nowrap" align="right" width="30%">广告名字:</td>
							    <td width="50%">
							      <s:textfield name="advertVo.advertName" theme="simple" size="20"></s:textfield>
						        <span class="red"> *</span>
						      </td>
							  </tr>					  
							  <tr>
							    <td nowrap="nowrap" align="right" width="13%">描述:</td>
							    <td width="87%">
							      <s:textarea name="advertVo.notes" rows="4" cols="30" theme="simple"></s:textarea>
						      </td>
							  </tr>
							  <tr>
							    <td nowrap="nowrap" align="right" width="13%">广告类型:</td>
							    <td width="87%">
							    	<s:action name="advertTypeAct!findAdvertType" id="advertDefTypeAct"/>	
							      <s:select name="advertVo.advertType" listKey="code"
											listValue="value" 	list="#advertDefTypeAct.advertTypeVoList" theme="simple" />
						        <span class="red"> *</span>
						      </td>
							  </tr>		
							  <tr>
							    <td nowrap="nowrap" align="right" width="13%">默认文件路径:</td>
							    <td width="87%">
							      <s:file name="uploadAdvert" theme="simple"></s:file>
							      <s:fielderror name=""  theme="simple"/>
						        <span class="red"> *</span>
						      </td>
							  </tr>
							</table>
					 		<br />
						</fieldset>
					</td>
				</tr>
				</table>
			 	</td>
		  </tr>
			<tr>
				<td colspan="2" align="center" height="50px">
					<s:if test="#butFlgVal!='upt'">                          
						<input type="button" name="initAdvertBtn" value="保&nbsp存"  onclick="javascript:addAdevert();"></input>
					</s:if>
					<s:else>
				  	<input type="button" name="uptAdvertBtn" value="修&nbsp改"  onclick="javascript:uptAdevert();"></input>
					</s:else>					
				</td>
			</tr>
		</table>	
		</div>
</form>
</body>
</html>

